package org.hxzon.workeasy.components.row;

import org.apache.tapestry5.ComponentResources;
import org.apache.tapestry5.annotations.OnEvent;
import org.apache.tapestry5.annotations.Parameter;
import org.apache.tapestry5.annotations.Property;
import org.apache.tapestry5.ioc.annotations.Inject;
import org.hxzon.tapestry5.components.base.CustomGrid;
import org.hxzon.workeasy.model.EasyJob;
import org.hxzon.workeasy.service.EasyJobService;

public class JobRow extends CustomGrid {

    @Property
    private EasyJob job;
    @Parameter
    @Property
    private boolean hideLink;

    @Inject
    private ComponentResources componentResources;
    @Inject
    private EasyJobService jobSer;

    @OnEvent(component = "delete")
    Object delete(String id) {
        jobSer.delete(id);
        return componentResources.getPage();
    }
}
